package com.yanqu.road.entity.autodata.chefduel;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.autodata.chefduel.entity.ChefDuel1DeviceGroup;
import com.yanqu.road.entity.autodata.chefduel.entity.ChefDuel1StageData;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@FieldTypeAnnotation(tableName = "t_u_chef_duel_phase1_user")
public class ChefDuelPhase1UserData extends DataObject {
    @FieldTypeAnnotation(select = true,update = true,desc = "活动id")
    private int activityId;
    @FieldTypeAnnotation(select = true,update = true,desc = "玩家id")
    private long userId;
    @FieldTypeAnnotation(desc = "体力数量")
    private int energyNum;
    @FieldTypeAnnotation(desc = "上次恢复体力的时间")
    private long lastRecoveryEnergyTime;
    @FieldTypeAnnotation(desc = "各区域设备等级")
    private Map<Integer, ChefDuel1DeviceGroup> deviceDataMap;
    @FieldTypeAnnotation(desc = "玩家剩余灵感点")
    private int remainPoint;
    @FieldTypeAnnotation(desc = "玩家总获得灵感点")
    private int totalGetPoint;
    @FieldTypeAnnotation(desc = "技能id,技能等级")
    private Map<Integer,Integer> skill;
    @FieldTypeAnnotation(desc = "当前餐馆评分")
    private long grade;
    @FieldTypeAnnotation(desc = "历史最高餐馆评分")
    private long highestGrade;
    @FieldTypeAnnotation(desc = "已通关关卡数据")
    private Map<Integer, ChefDuel1StageData> passStages;
    @FieldTypeAnnotation(desc = "历史改造次数")
    private int totalModifyTime;
    @FieldTypeAnnotation(desc = "积分")
    private long score;

    public int getActivityId() {
        return activityId;
    }
    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getEnergyNum() {
        return energyNum;
    }
    public void setEnergyNum(int energyNum) {
        if (this.energyNum != energyNum) {
            this.energyNum = energyNum;
            setOp(DataStatus.Update);
        }
    }

    public long getLastRecoveryEnergyTime() {
        return lastRecoveryEnergyTime;
    }
    public void setLastRecoveryEnergyTime(long lastRecoveryEnergyTime) {
        if (this.lastRecoveryEnergyTime != lastRecoveryEnergyTime) {
            this.lastRecoveryEnergyTime = lastRecoveryEnergyTime;
            setOp(DataStatus.Update);
        }
    }

    public java.util.Map<java.lang.Integer, ChefDuel1DeviceGroup> getDeviceDataMap() {
        return deviceDataMap;
    }
    public void setDeviceDataMap(java.util.Map<java.lang.Integer, ChefDuel1DeviceGroup> deviceDataMap) {
        if (null == deviceDataMap){
            return;
        }
        if (this.deviceDataMap == null || !this.deviceDataMap.equals(deviceDataMap)) {
            this.deviceDataMap = deviceDataMap;
            setOp(DataStatus.Update);
        }
    }

    public int getRemainPoint() {
        return remainPoint;
    }
    public void setRemainPoint(int remainPoint) {
        if (this.remainPoint != remainPoint) {
            this.remainPoint = remainPoint;
            setOp(DataStatus.Update);
        }
    }

    public int getTotalGetPoint() {
        return totalGetPoint;
    }
    public void setTotalGetPoint(int totalGetPoint) {
        if (this.totalGetPoint != totalGetPoint) {
            this.totalGetPoint = totalGetPoint;
            setOp(DataStatus.Update);
        }
    }

    public List<Map<String,String>> getStringSkill(){
        List<Map<String,String>> list = new ArrayList<>();
        try {
            for (Map.Entry<Integer,Integer>entry :skill.entrySet()){
                Map<String,String> map = new HashMap<>();
                map.put("id",String.valueOf(entry.getKey()));
                map.put("lev",String.valueOf(entry.getValue()));
                list.add(map);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return list;
    }

    public java.util.Map<java.lang.Integer, java.lang.Integer> getSkill() {
        return skill;
    }
    public void setSkill(java.util.Map<java.lang.Integer, java.lang.Integer> skill) {
        if (null == skill){
            return;
        }
        if (this.skill == null || !this.skill.equals(skill)) {
            this.skill = skill;
            setOp(DataStatus.Update);
        }
    }

    public long getGrade() {
        return grade;
    }
    public void setGrade(long grade) {
        if (this.grade != grade) {
            this.grade = grade;
            setOp(DataStatus.Update);
        }
    }

    public Map<Integer, ChefDuel1StageData> getPassStages() {
        return passStages;
    }

    public void setPassStages(Map<Integer, ChefDuel1StageData> passStages) {
        if (null == passStages){
            return;
        }
        if (this.passStages == null || !this.passStages.equals(passStages)) {
            this.passStages = passStages;
            setOp(DataStatus.Update);
        }
    }

    public int getTotalModifyTime() {
        return totalModifyTime;
    }
    public void setTotalModifyTime(int totalModifyTime) {
        if (this.totalModifyTime != totalModifyTime) {
            this.totalModifyTime = totalModifyTime;
            setOp(DataStatus.Update);
        }
    }

    public long getHighestGrade() {
        return highestGrade;
    }

    public void setHighestGrade(long highestGrade) {
        if (this.highestGrade != highestGrade) {
            this.highestGrade = highestGrade;
            setOp(DataStatus.Update);
        }
    }

    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        if (this.score != score) {
            this.score = score;
            setOp(DataStatus.Update);
        }
    }
}
